<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Deletes a service entry from the SCM database</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.win32-delete-service" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">win32_delete_service</h1>
  <p class="verinfo">(PECL win32service &gt;=0.1.0)</p><p class="refpurpose"><span class="refname">win32_delete_service</span> &mdash; <span class="dc-title">Deletes a service entry from the SCM database</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.win32-delete-service-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>win32_delete_service</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$servicename</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$machine</code></span>
  ] ) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>


  <p class="para rdfs-comment">
   Attempts to delete a service from the SCM database.  Administrative
   privileges are required for this to succeed.
  </p>
  <p class="para">
   This function really just marks the service for deletion.  If other
   processes (such as the Services Applet) are open, then the deletion will be
   deferred until those applications are closed.  If a service is marked for
   deletion, further attempts to delete it will fail, and attempts to create a
   new service with that name will also fail.
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-function.win32-delete-service-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">servicename</code></dt>

     <dd>

      <p class="para">
       The short name of the service.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">machine</code></dt>

     <dd>

      <p class="para">
       The optional machine name.  If omitted, the local machine will be used.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.win32-delete-service-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    成功时返回 <strong><code>WIN32_NO_ERROR</code></strong>，参数错误时返回 <strong><code>FALSE</code></strong>，或失败时返回一个 <a href="win32service.constants.errors.html" class="link">Win32 错误码</a>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.win32-delete-service-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example.com2">
    <p><strong>Example #1 A <span class="function"><strong>win32_delete_service()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     Deletes the dummyphp service.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />win32_delete_service</span><span style="color: #007700">(</span><span style="color: #DD0000">'dummyphp'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.win32-delete-service-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="win32_create_service.html" class="function" rel="rdfs-seeAlso">win32_create_service()</a> - Creates a new service entry in the SCM database</span></li>
    <li class="member"><a href="win32service.constants.errors.html" class="link">Win32 Error Codes</a></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>